﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NUnit.Framework;

namespace Milo.Tests
{
    [TestFixture]
    public class NamingTests
    {
        [Test]
        public void ModelIDOnSimpleTypeWithNoName()
        {
            Mock.Controls.SimpleTypeControl simple = new Milo.Tests.Mock.Controls.SimpleTypeControl(new Mock.SimpleType());

            Assert.AreEqual("StringValue", simple.StringValue.ModelID);
            Assert.AreEqual("IntValue", simple.IntValue.ModelID);
        }

        [Test]
        public void ModelIDOnSimpleTypeWithName()
        {
            Mock.Controls.SimpleTypeControl simple = new Milo.Tests.Mock.Controls.SimpleTypeControl("SimpleType", new Mock.SimpleType());

            Assert.AreEqual("SimpleType.StringValue", simple.StringValue.ModelID);
            Assert.AreEqual("SimpleType.IntValue", simple.IntValue.ModelID);
        }

        [Test]
        public void ModelIDOnHierTypeWithNoName()
        {
            Mock.Controls.HierTypeControl simple = new Milo.Tests.Mock.Controls.HierTypeControl(new Mock.HierType());

            Assert.AreEqual("SimpleObject", simple.SimpleObject.ModelID);
            Assert.AreEqual("SimpleObject.StringValue", simple.SimpleObject.StringValue.ModelID);
        }

        [Test]
        public void ModelIDOnHierTypeWithName()
        {
            Mock.Controls.HierTypeControl simple = new Milo.Tests.Mock.Controls.HierTypeControl("HierType", new Mock.HierType());

            Assert.AreEqual("HierType.SimpleObject", simple.SimpleObject.ModelID);
            Assert.AreEqual("HierType.SimpleObject.StringValue", simple.SimpleObject.StringValue.ModelID);
        }

        [Test]
        public void GetSignatureID()
        {
            Mock.Controls.SimpleTypeControl simple = new Milo.Tests.Mock.Controls.SimpleTypeControl("SimpleType", new Mock.SimpleType());

            Assert.AreEqual("Milo.Tests.Mock.SimpleType.StringValue", simple.StringValue.SignatureID);
        }
    }
}
